package jianzhi_offer;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-04-10 15:41
 */
public class _57_对称的二叉树 {
    boolean isSymmetrical(TreeNode pRoot)
    {
        if (pRoot == null) return true;
       return help(pRoot.left,pRoot.right);
    }

    private boolean help(TreeNode t1,TreeNode t2){
        if(t1 == null){
            if(t2 == null) return true;
            return false;
        }
        if(t2 == null){
            return false;
        }
        if(t1.val != t2.val) return false;
        return help(t1.right,t2.left) && help(t1.left,t2.right);
    }
}
